Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Java Behaviour w.r.t Math.max and Math.min for Floating Points #20465

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matthewhall2
Copy link
Contributor

  • Enables inlining of Math.max/Math.min functions for floats and doubles
  • Implements Java standard found while testing
    • +0 compares as strictly greater than -0
    • if the first arg is a NaN, returns the corresponding quiet NaN, same for if only the second arg is a NaN

This is the same as #20185 with the functional test change removed

sarwat12 and others added 2 commits October 30, 2024 17:06
- Adds java_lang_Math_max/min_float/double as a recognized method
- Adds a SupportsInlineMath_MaxMin_FD flag to the Z code generator
- Flag is only set in Z if the TR_disableInlineMath_MaxMin_FD
  environment variable is not set
- If the flag is set, call nodes are transformed to a functionally
  equivalent tree that uses fmin/fmax/dmin/dmax nodes

Signed-off-by: Sarwat Shaheen <[email protected]>
- spearate evaluators for J9 vs OMR to support differing behaviour (OMR
  complies with IEEE_754, while J9 returns the first NaN (if present)
- +0.0 compares as strictly greater than -0.0

Signed-off-by: Matthew Hall <[email protected]>
@pshipton
Copy link
Member

The original change was causing crashes on z/OS.

@pshipton
Copy link
Member

Setting as draft until the z/OS problems are resolved.

@pshipton pshipton marked this pull request as draft October 31, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants